class UserMailer < ActionMailer::Base

  # TODO: Setup these parameters
  def registration(user)
    setup_email(user)
    @subject    += 'Please activate your new account'
    @body[:url]  = "http://spendy.johnwyles.com/users/#{user.activation_code}/activate"
  end

  # TODO: Setup these parameters
  def activation(user)
    setup_email(user)
    @subject    += 'Your account has been activated!'
    @body[:url]  = "http://spendy.johnwyles.com/"
  end

  def suspension
    setup_email(user)
    @subject    += 'Your account has been suspended for abuse.'
    @body[:url]  = "http://spendy.johnwyles.com/support"
  end

  def deletion
    setup_email(user)
    @subject    += 'Your account has been deleted.'
    @body[:url]  = "http://spendy.johnwyles.com/support"
  end

  # TODO: Setup these parameters
  protected
    def setup_email(user)
      @recipients  = "#{user.email}"
      @from        = "webmaster@johnwyles.com"
      @subject     = "[spendy.johnwyles.com] "
      @sent_on     = Time.now
      @body[:user] = user
    end
end
